<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery.min.js"></script>
</head>

<body>
    <form>
        username:<input value="admin" type="text" name="" id=""> </br>
        password:<input value="123456" type="text" name="" id=""> </br>
        <input type="button" id='btn' value="按钮">
    </form>

    <script>
        function  qq(res){
            console.log(res,8888)
        }

        $('#btn').on('click', function () {
            $.ajax({
                url: 'http://127.0.0.1:2000/login',
                dataType:'jsonp',
                data: $('form').serialize(),
                jsonpCallback:'qq',
                success: function (res) { //  res=>qq([{id:1,name:'jack'}])
                    console.log(res,9999) //  这里是调用函数
                },
            })
        })

    </script>
</body>

</html>